package com.kalua.list.harvester.tesco;

import com.kalua.list.domainmodel.TextIdentifier;
import com.kalua.list.harvester.crawldata.CrawlEntryPoints;

public class TescoCrawlEntryPoints implements CrawlEntryPoints {
	
	private final String[] links;
	private final TextIdentifier retailerId;
	
	public TescoCrawlEntryPoints(TextIdentifier retailerId) {
		this.retailerId = retailerId;		
		this.links = initializeLinksArray();		
	}
	
	@Override
	public TextIdentifier getRetailerId() { return this.retailerId; }

	@Override
	public String[] getLinks() { return this.links; }
	
	@Override
	public String listToString() {
		StringBuffer result = new StringBuffer();
		for(String point : this.links) 
			result.append("\n\t" + point);
		return result.toString();
	}
		
	private String[] initializeLinksArray() {
		String[] insertionPoints;
		
		String 	freshFood, bakery, foodCupboard,
					frozenFood, drinks,baby, healthAndBeauty,
					pets, houseHold, homeEntertainment;
		freshFood = "http://www.tesco.com/groceries/department/default.aspx?N=4294793659&Ne=4294793660";
		bakery = "http://www.tesco.com/groceries/department/default.aspx?N=4294793221&Ne=4294793660";
		foodCupboard = "http://www.tesco.com/groceries/department/default.aspx?N=4294793102&Ne=4294793660";
		frozenFood = "http://www.tesco.com/groceries/department/default.aspx?N=4294792797&Ne=4294793660";
		drinks = "http://www.tesco.com/groceries/department/default.aspx?N=4294792677&Ne=4294793660";
		baby = "http://www.tesco.com/groceries/department/default.aspx?N=4294792677&Ne=4294793660";
		healthAndBeauty = "http://www.tesco.com/groceries/department/default.aspx?N=4294792413&Ne=4294793660";
		pets = "http://www.tesco.com/groceries/department/default.aspx?N=4294792222&Ne=4294793660";
		houseHold = "http://www.tesco.com/groceries/department/default.aspx?N=4294792222&Ne=4294793660";
		homeEntertainment = "http://www.tesco.com/groceries/department/default.aspx?N=4294792074&Ne=4294793660";
		
		insertionPoints = new String[] {freshFood, bakery, foodCupboard, frozenFood, drinks, baby,
														healthAndBeauty, pets, houseHold, homeEntertainment };
		return insertionPoints;
	}	
}